package cn.car.domains.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class BasePage<T> {

    private Long total = 0L;

    private long pages;

    private List<T> list;

    public static <T> BasePage<T> generateResult(long pages, Long total, List<T> list){
        BasePage<T> result = new BasePage<>();
        result.setPages(pages);
        result.setTotal(total);
        result.setList(list);
        return result;
    }
}
